package com.huirui.server.controller.mini.program;

import com.huirui.server.pojo.dto.StockShortageRecordDto;
import com.huirui.server.pojo.result.Result;
import com.huirui.server.service.StockShortageRecordService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/stock/shortage/record")
@Slf4j
@Validated
@Tag(name = "缺货管理", description = "小程序缺货管理相关API")
@RequiredArgsConstructor
class StockShortageRecordController {

    final private StockShortageRecordService stockShortageRecordService;

    @PostMapping
    @Operation(summary = "新增缺货申请")
    public Result<Void> addNewShortageRecordApplication(@RequestBody StockShortageRecordDto stockShortageRecordDto) {
        stockShortageRecordService.addNewShortageRecordApplication(stockShortageRecordDto);
        return Result.success();
    }


}
